import request from "./request.js";

export function Login(data){
    return request.post("/auth/user/login",data)
}
export function Registry(data){
    return request.post("/auth/user/registry",data)
}
export function GetUserInfo(){
    return request.get("/auth/user/id")
}
export function GetInvited(){
    return request.get("/auth/user/invite/record")
}
export function GetInvitedIncome(){
    return request.get("/auth/user/invite/income")
}
export function GetUserBalanceList(){
    return request.get("/auth/user/balance/change/list")
}

//车辆查询 wxq
export function GetCarsList(){
    return request.get("/auth/cars/CarList")
}
// 车牌号 wxq
export function GetLicensePlate(){
    return request.get("/auth/cars/LicenseList")
}
// 车辆品牌 wxq
export function GetBrandList(){
    return request.get("/auth/cars/BrandList")
}
// 车辆图片上传 wxq
export function GetCarSaveMinio(file){
    return request.post("/auth/cars/CarsSaveMinio",file)
}
// 车辆添加 wxq
export function GetCarAdd(data){
    return request.post("/auth/cars/CarsAdd",data)
}
// 车辆省份回值 wxq
export function GetCarsProvince(data){
    return request.post("/auth/cars/CarsProvince", data)
}
// 车辆更新 wxq
export function GetCarsUpdate(data){
    return request.post("/auth/cars/CarsUpdate", data)
}
export function GetCarsBatteryCapacity(data){
    return request.post("/auth/cars/CarsBatteryCapacity", data)
}

export function getChargeRecordList(payStatus){
    return request.post("/auth/core/charge/list", {payStatus})
    // return request.get("/user/api/user/balance/change/list")
}
// 修改用户基本信息
export function updateUserInfoJs(form){
    return request.post("/auth/user/updateUserInfo",form)
}

// 处理用户头像信息
export function updateAvatarImgJs(file){
    return request.post("/auth/user/file/uploadAvatarImg",file)
}
// 退出登录
export function userLogoutJs(){
    return request.get("/auth/user/logout")
}

// 查询积分历史记录
export function userHistoryChangesJs(form){
    return request.post("/auth/user/select/points/change",form)
}

// 图片上传
export function UploadImg(data) {
  return request({
    url: '/auth/user/user/uploadImg', // 确保这是正确的上传接口地址
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data
  })
}
// 异常上传
export function SentYichang(data){
    return request.post("/auth/user/user/sendException", data)
}
//获取奖品列表
export function GetGiftsJs(){
    return request.get("/auth/user/gift/getGifts")
}
//添加抽奖记录
export function AddLotteryRecord(data){
    return request.get("/auth/user/gift/addGift",{params:{id:data}})
}
//获取用户的抽奖记录
export function GetLotteryHistory(){
    return request.get("/auth/user/gift/getUserGifts")
}

//兑换奖品
export function ExchangeGoods(data){
    return request.get("/auth/user/gift/exchangeGoods",{params:{giftId:data}})
}
//获取商品列表
export function GetProductList(){
    return request.get("/auth/user/product/getProducts")
}
//增加商品
export function AddProduct(data){
    return request.post("/auth/user/product/addProduct",data)
}
//修改商品
export function UpdateProduct(data){
    return request.post("/auth/user/product/updateProduct",data)
}
//删除商品
export function DeleteProduct(data){
    return request.post("/auth/user/product/deleteProduct", {id:data})
}
//兑换商品
export function ExchangeProduct(data){
    return request.post("/auth/user/product/exchangeProduct", {id:data})
}
//获取用户商品列表
export function GetUserProductList(){
    return request.get("/auth/user/product/getUserProducts")
}
//上传商品图片
export function UploadProductImg(data){
    return request.post("/auth/user/product/uplodaImg",data)
}